import os
from resources_ import *
from images import *
from output import *

test_dir = os.path.dirname(__file__)

base = os.path.realpath(os.path.join(test_dir,"../resources"))
arg = os.path.realpath(os.path.join(test_dir,"../arguments"))
output_dir = os.path.realpath(os.path.join(test_dir,"../output"))

def test():
    # ability test
    a = get_ability(base, "allstrike")
    # cost test
    c = get_cost(base, 4, "blood")
    # base test
    fr = get_card_base(base, "normal", "front")
    ba = get_card_base(base, "normal", "back")
    # decal test
    d = get_decal(base, "smoke_abilityhole")
    # font test
    font_zh = get_font(base, "Noto_Serif_SC")
    font_en = get_font(base, "HEAVYWEI")
    # number test
    text = generate_text_image("你需偿还", font_zh, font_en)
    print(text)
    # load card test
    cards = get_cards_data(arg)
    card_1 = cards[0]
    alc =load_card(base, card_1[0], card_1[1], font_zh, font_en)
    print(alc)
    front, back = create(alc)
    output(output_dir,"squirrel",front,back)

if __name__ == "__main__":
    test()